package com.easy.service.impl;

import com.easy.bean.Order;
import com.easy.dao.IOutInventoryDao;
import com.easy.service.IOutInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OutInventoryImpl implements IOutInventoryService {
    @Autowired
    private IOutInventoryDao dao;

    @Override
    public List<Order> getOutInventory() {
        return dao.getOutInventory();
    }

    @Override
    public List<Order> getShelfOutInventory() {
        return dao.getShelfOutInventory();
    }

    @Override
    public int addOutInventory(Order order) {
        return dao.addOutInventory(order);
    }

    @Override
    public int editOutInventory(Order order) {
        return dao.editOutInventory(order);
    }

    @Override
    public int delOutInventory(int id) {
        return dao.delOutInventory(id);
    }

    @Override
    public List<Order> searchOutInventory(String keyword) {
        return dao.searchOutInventory(keyword);
    }
    @Override
    public List<Order> getPagedOutInventory(int page, int size) {
        int offset = (page - 1) * size; // 计算 offset
        return dao.getPagedOutInventory(offset, size);
    }
    @Override
    public int getTotalOutInventoryCount() {
        return dao.getTotalOutInventoryCount();
    }
}
